<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:commandButton value="refresh Table" rendered="false">
		<f:ajax render="caracteristicasTable" execute="@this" />
	</h:commandButton>
	<rich:dataTable keepSaved="true" id="caracteristicasTable"
		var="record_" style="width: 100%"
		value="#{bienCaracteristicaManager.dataModel}" rows="10"
		noDataLabel="${msg['general.registrosNoEncontrados']}">
		<ui:include src="/resources/sijyp/jpaColumn.xhtml">
			<ui:param name="bean" value="#{bienCaracteristicaManager}" />
			<ui:param name="propertyTitle"
				value="bienes.tablaCaracteristicas.idBien" />
			<ui:param name="explicitProperty" value="#{record_.bien.idBien}" />
			<ui:param name="propertyFilter" value="bien.idBien" />
			<ui:param name="componentRender" value="caracteristicasTable" />
			<ui:param name="hideColumn" value="true" />
		</ui:include>
		
		<ui:include src="/resources/sijyp/jpaColumn.xhtml">
			<ui:param name="bean" value="#{bienCaracteristicaManager}" />
			<ui:param name="propertyTitle"
				value="bienes.tablaCaracteristicas.caracteristica" />
			<ui:param name="explicitProperty"
				value="#{record_.tpSubcaracteristicaBien.tpCaracteristicaBien.nombre}" />
			<ui:param name="propertyFilter"
				value="tpSubcaracteristicaBien.tpCaracteristicaBien.nombre" />
			<ui:param name="componentRender" value="caracteristicasTable" />
		</ui:include>
		<ui:include src="/resources/sijyp/jpaColumn.xhtml">
			<ui:param name="bean" value="#{bienCaracteristicaManager}" />
			<ui:param name="propertyTitle"
				value="bienes.tablaCaracteristicas.subcaracteristica" />
			<ui:param name="explicitProperty"
				value="#{record_.tpSubcaracteristicaBien.nombre}" />
			<ui:param name="propertyFilter"
				value="tpSubcaracteristicaBien.nombre" />
			<ui:param name="componentRender" value="caracteristicasTable" />
		</ui:include>
		<ui:include src="/resources/sijyp/jpaColumn.xhtml">
			<ui:param name="bean" value="#{bienCaracteristicaManager}" />
			<ui:param name="propertyTitle"
				value="bienes.tablaCaracteristicas.valor" />
			<ui:param name="explicitProperty" value="#{record_.valor}" />
			<ui:param name="propertyFilter" value="" />
			<ui:param name="componentRender" value="caracteristicasTable" />
		</ui:include>
		<ui:include src="/resources/sijyp/jpaColumn.xhtml">
			<ui:param name="bean" value="#{bienCaracteristicaManager}" />
			<ui:param name="propertyTitle"
				value="bienes.tablaCaracteristicas.tipoDeDocumento" />
			<ui:param name="explicitProperty" value="#{record_.tipoDocumento}" />
			<ui:param name="propertyFilter" value="" />
			<ui:param name="componentRender" value="caracteristicasTable" />
		</ui:include>
		<ui:include src="/resources/sijyp/jpaColumn.xhtml">
			<ui:param name="bean" value="#{bienCaracteristicaManager}" />
			<ui:param name="propertyTitle"
				value="bienes.tablaCaracteristicas.archivo" />
			<ui:param name="explicitProperty" value="#{record_.archivo}" />
			<ui:param name="propertyFilter" value="" />
			<ui:param name="componentRender" value="caracteristicasTable" />
			<ui:param name="record" value="#{record_.bienDocumento}" />
			<ui:param name="link" value="true" />
		</ui:include>

		<rich:column>
			<f:facet name="header">
				<h:commandLink value="${msg['bienes.tablaCaracteristicas.accion']}">
					<f:ajax execute="@none" />
				</h:commandLink>
			</f:facet>
			<h:panelGrid columns="3"
				columnClasses="icon_space,icon_space,icon_space,icon_space,icon_space">

				<h:commandLink action="#{bienCaracteristicaManager.prepareUpdate}"
					rendered="#{!bienCaracteristicaManager.reading and !bienManager.reading and !bienManager.disableSubtabsEditAction}">
					<h:graphicImage value="/resources/images/icons/ico_pencil.png"
						title="${msg['boton.editar']}" />
					<f:setPropertyActionListener
						target="#{bienCaracteristicaManager.subcaracteristica}"
						value="#{record_}" />
					<f:setPropertyActionListener
						target="#{bienCaracteristicaManager.crud}" value="update" />
					<f:ajax execute="@this"
						render=":formTabs:caracteristicasContainer :sijypMessages" />
				</h:commandLink>

				<ui:remove>Gray edit action icon</ui:remove>
				<h:graphicImage value="/resources/images/icons/ico_pencil_gray.png"
					title="${msg['boton.editar']}"
					rendered="#{bienManager.disableSubtabsEditAction}" />

				<h:commandLink action="#{bienCaracteristicaManager.prepareRead}">
					<h:graphicImage value="/resources/images/icons/ico_details.png"
						title="${msg['boton.consultar']}" />
					<f:setPropertyActionListener
						target="#{bienCaracteristicaManager.subcaracteristica}"
						value="#{record_}" />
					<f:setPropertyActionListener
						target="#{bienCaracteristicaManager.crud}" value="read" />
					<f:ajax execute="@this"
						render=":formTabs:caracteristicasContainer :sijypMessages" />
				</h:commandLink>

				<a4j:commandLink value="" execute="@this" render="@none"
					title="${msg['boton.eliminar']}"
					rendered="#{!bienCaracteristicaManager.reading and !bienManager.reading and !bienManager.disableSubtabsDeleteAction}"
					oncomplete="#{rich:component('confirmDeleteCaracteristica')}.show()">
					<h:graphicImage value="/resources/images/icons/ico_delete.png"
						title="${msg['boton.aceptar']}" />
					<a4j:param value="#{record_.idSubcaracteristicaBienValor}"
						assignTo="#{bienCaracteristicaManager.idSubcaracteristicaDelete}" />
				</a4j:commandLink>

				<ui:remove>Gray delete action icon</ui:remove>
				<h:graphicImage
					value="/resources/images/icons/ico_delete_disabled.png"
					title="${msg['boton.aceptar']}"
					rendered="#{bienManager.disableSubtabsDeleteAction}" />
			</h:panelGrid>
		</rich:column>
		<f:facet name="footer">
			<rich:dataScroller maxPages="10" fastStep="5" fastControls="hide" stepControls="show" />
		</f:facet>
	</rich:dataTable>
</ui:composition>
